A formal grammar is a set of fixed rules that define the valid constructions in a languages. This may be used in natural language processing to model an existing language. It may also be used to define an artificial language, in particular for programming languages.
Portion of formal grammar for a simple programmibg language:
expression ::== expression | expression operator expression | '(' expression ')' statement ::== 'IF' expression 'THEN' statements 'ELSE' statments 'FI' | 'LET' variable '=' expression statements ::== statement | statement ';' statements
xxx
Used on Chap. 13: pages 311, 314